<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>CRM客户关系管理系统</title>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<meta http-equiv="Cache-Control" content="no-store" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Expires" content="0" />

		<script type="text/javascript" src="${path}/script/jquery-1.6.1.js">
</script>
		<script type="text/javascript" src="${path}/ckeditor/ckeditor.js">
</script>
		<script type="text/javascript" src="${path}/ckfinder/ckfinder.js">
</script>
		<script type="text/javascript" src="${path}/script/jquery.form.js">
</script>
		<script type="text/javascript"
			src="${path}/script/artDialog.js?skin=opera">
</script>
		<script type="text/javascript"
			src="${path}/script/My97DatePicker/WdatePicker.js">
</script>
		<!--JQuery Validate-->
		<script type="text/javascript"
			src="${path }/script/jquery.metadata.js">
</script>
		<script type="text/javascript"
			src="${path}/script/jquery.validate.min.js">
</script>
		<script type="text/javascript" src="${path}/script/messages_cn.js"
			charset="UTF-8">
</script>
		<script type="text/javascript" src="${path}/script/sorttable.js">
</script>
<script type="text/javascript" src="../script/common/common.js"></script>
		<style type="text/css">
.main_left {
	float: left;
	width: 210px;
	height: auto;
}

.main_right {
	float: left;
	width: 740px;
	height: 800px;
}

#picarea {
	MARGIN: 0px auto;
	WIDTH: 740px;
	HEIGHT: 200px;
}

#smallpicarea {
	MARGIN: 0px auto;
	WIDTH: 740px;
	height: 50px;
}

#thumbs {
	LIST-STYLE-TYPE: none;
	MARGIN: 0px auto;
	WIDTH: 740px;
	height: 50px;
}

.slideshowItem {
	float: left;
	width: 90px;
	height: 40px;
	MARGIN: 5px 5px;
}

.slideshowItem img {
	width: 90px;
	height: 40px;
	cursor: pointer;
}

.slideshowItem .current {
	BORDER: #f8ae0f 1px solid;
}

.playbtn {
	cursor: pointer;
}

.title {
	width: 50px;
	white-space: nowrap;
	word-break: keep-all;
	overflow: hidden;
	text-overflow: ellipsis;
}
#title { 
	display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 160px; }
.bx {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	width: 200px;
}
</style>
		<script type="text/javascript">

//左边显示新闻第一条
function firstNews(){
	var new1 = $("#new0");
	if (new1) {
		new1.mouseover();
	}
	}
//左边显示通知公告第一条
function firstNotice(){
	var notice1 = $("#notice0");
	if (notice1) {
		notice1.mouseover();
	}
	}

//选择切换新闻与通知公告type1代表新闻
function change(param) {
	if (param.attr("id") == "type1") {
		$("#type1").attr("class", "current");
		$("#type2").attr("class", "");
		$("#notice").css("display","none");
		$("#news").css("display","block");
		$("#newsMore").attr("href","${path}/news/index/more?type=1");
		firstNews();
	}

	if (param.attr("id") == "type2") {
		$("#type2").attr("class", "current");
		$("#type1").attr("class", "");
		$("#notice").css("display","block");
		$("#news").css("display","none");
		$("#newsMore").attr("href","${path}/news/index/more?type=2")
		firstNotice();
	}
}



function changeMeeting(param) {
	if (param.attr("id") == "meeting1") {
		$("#meeting1").attr("class", "current");
		$("#meeting2").attr("class", "");
		$("#sharemeeting").css("display","none");
		$("#innermeeting").css("display","block");
		$("#meetingmore").attr("href","${path}/news/index/meetingmore?isInner=Y")
	}

	if (param.attr("id") == "meeting2") {
		$("#meeting2").attr("class", "current");
		$("#meeting1").attr("class", "");
		$("#sharemeeting").css("display","block");
		$("#innermeeting").css("display","none");
		$("#meetingmore").attr("href","${path}/news/index/meetingmore?isInner=N")
	}
}


function jingban(){
	alert("暂无数据");
}

/*//去年图片标记
function delHtmlTag(str) {
	return str.replace(/&ltimg.+>/g, "");
}

//过滤出内容第一张图片用来显示在左边
function getSrc(str) {

	//思路分两步：作者（yanue）.

	//1，匹配出图片img标签（即匹配出所有图片），过滤其他不需要的字符

	//2.从匹配出来的结果（img标签中）循环匹配出图片地址（即src属性）

	//匹配图片（g表示匹配所有结果i表示区分大小写）

	var imgReg = /&ltimg.*?(?:>|\/>)/gi;

	//匹配src属性

	var srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i;

	var arr = str.match(imgReg);

	//alert('所有已成功匹配图片的数组：'+arr);

	if (arr) {
		for ( var i = 0; i < arr.length; i++) {

			var src = arr[i].match(srcReg);

			//获取图片地址

			if (src != null && src.length > 0) {

				//alert('已匹配的图片地址'+(i+1)+'：'+src[1]);
				return src[1];
			}
		}
	}
}
*/
//走马灯效果
function move(str){
	var last=str.substring(str.length-1,str.length);
	var first=str.substring(0,str.length-1);
	return last+""+first;
}

$(function() {
	change($("#type2"));
	var intervalId=setInterval(function(){$("#most").text(move($("#most").text()))},1000);
	//最新通知公告
	var notice1 = $("#notice0");
	if (notice1) {
		var title=notice1.attr("ntitle");
		var id=notice1.attr("nid");
		var most=$("#most");
		most.attr("href","${path}/news/index/view/"+id);
		most.text(title);
	}
	

	//荣誉显示切换
	$(".promot").click(function() {
		var s = $(this).attr("aname");
		var path = $(this).attr("apath");
		$("#aname").text($(this).attr("aname"));
		$("#alevel").text($(this).attr("alevel"));
		$("#big").attr("src", path);
	});
	
	//默认显示第一个代理人
	var li1 = $("#li0");
	if (li1) {
		li1.click();
	}
	
	//移动到新闻标题进行切换
	$(".news").mouseover(function() {
		var title = $(this).attr("ntitle");
		var content = $(this).attr("ncontent");
		var src=$(this).attr("src");
		var id=$(this).attr("nid");
		$("#ntitle").text(title);
		//alert(content);
			$("#ncontent").text(content);
			
			if (!src) {
				src = "../statics/images/pic-news.png";
			}
			$("#bigNew").attr("src", src);
			$("#ntitle").attr("href","${path}/news/index/view/"+id);
		});
	//设置开始新闻
	firstNews();
	var type = '${type}';
	type="2";
	if (type) {
		if (type == "1") {
			$("#type1").attr("class", "current");
		} else {
			$("#type2").attr("class", "current");
		}
	}
	//加载待处理业务数 
	$.ajax( {
		url : "${path}/news/index/getBusiness",
		type : 'POST',
		success : function(result) { 
			var j = $("<span>" + result + "</span>").html();
			var obj = eval("(" + j + ")");
			
			$("#a1").html(obj.THISMONTHUNDERWRITEEDS);
			$("#a2").html(obj.THISMONTHNOUNDERWRITEEDS);
			$("#b1").html(obj.THISMONTHNOTEEDS);
			$("#b2").html(obj.THISMONTHNONOTEEDS);
			$("#c1").html(obj.THISMONTHRECEIPTEDS);
			$("#c2").html(obj.THISMONTHNORECEIPTEDS);
			$("#d1").html(obj.THISMONTHSURRENDEREDS);
			$("#d2").html(obj.THISMONTHHEAREDS); 
		}

	});
});
</script>


		<link rel="stylesheet"
			href="${path }/statics/themes/default/style.css" />
	</head>

	<body id="master">

		<sfa:indexHeader></sfa:indexHeader>

		<div class="notes">
			<p>
				<span>最新通知：</span> 
				
				<a href="#" id="most"> </a>
			</p>
		</div>

		<div class="b_d1">
			<div class="lfloat">
				<div class="webpart1">
					<div class="webpart-head">
						<div class="webpart-head-item">
						</div>
					</div>
					<div class="webpart-main">
						<div class="webpart-main-item" style="padding-top: 12px;">
							<div class="index-news">
								<div class="pic-news">
									<img src="../statics/images/pic-news.png" id="bigNew"
										style="width: 281px; height: 230px;" />
									<h1>
										<a href="javascript:void(0);" id="ntitle"> </a>
									</h1>
									<p id="ncontent">
										 
									</p>
								</div>
								<div class="news-list">
									<ul class="news-list-title">
										 
										<a href="${path }/news/index/more?type=1"
											style="float: right;" id="newsMore">更多>></a>
										<li>
											<a href="javascript:void(0)" id="type2"
												onclick="change($(this))">通知公告</a>
										</li>
									</ul>
									
									
									
									<div class="news-list" id="news">
									<ul class="news-list-content">

										<c:forEach items="${newsPagination.resultList}" var="news" varStatus="count">
									<p class="title">
										<li class="news" id="new${count.index}"
												nid="${news.saleNewsId}"	ntitle="${news.newsTitle}"
													ncontent='${ news.newAffixUrl1}' src='${news.affixPat}'>
												<span><fmt:formatDate value="${news.createDate}"
													pattern="yyyy/MM"/> </span>
												<a href="${path}/news/index/view/${news.saleNewsId}">${news.newsTitle}</a>
											</li>
									</p>
									</c:forEach>

									</ul>
								</div>
								
								<div class="notice-list" id="notice"  >
									<ul class="news-list-content">

										<c:forEach items="${noticePagination.resultList}" var="notice" varStatus="count">
									<p class="title">
										<li class="news" id="notice${count.index}"
													nid="${notice.saleNewsId}" ntitle="${notice.newsTitle}"
													ncontent='${ notice.newAffixUrl1}' src='${notice.affixPat}'>
												<span><fmt:formatDate value="${notice.createDate}"
													pattern="yyyy/MM"/> </span>
												<a href="${path}/news/index/view/${notice.saleNewsId}">${notice.newsTitle}</a>
											</li>
									</p>
									</c:forEach>

									</ul>
								</div>
								</div>
							</div>
							<div style="clear: both">
							</div>
						</div>
					</div>
					<div class="webpart-foot">
						<div class="webpart-foot-item">
						</div>
					</div>
				</div>
				<!--待办事项-->
				<div class="div-daiban">
					<ul>
						<%-- <li>
							<a href="${path}/news/index/getSpBusiness?type=a1">本月已承保件数(<em
								id="a1"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=b1">本月已照会件数(<em
								id="b1"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=c1">本月已回执件数(<em
								id="c1"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=d1">本月退保撤单件数(<em
								id="d1"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=a2">本月未承保件数(<em
								id="a2"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=b2">本月未照会件数(<em
								id="b2"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=c2">本月未回执件数(<em
								id="c2"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li>
						<li>
							<a href="${path}/news/index/getSpBusiness?type=d2">本月新受理件数(<em
								id="d2"><img src="${path}/images/059.gif" style="width:10px;height:10px;"/></em>)</a>
						</li> --%>
					</ul>
				</div>
			</div>
			<div class="rfloat">
				<div class="webpart1">
					<div class="webpart-head">
						<div class="webpart-head-item">
						</div>
					</div>
					<div class="webpart-main">
						<div class="webpart-main-item">
							<img src="../statics/images/index-fongyu.gif" />
							<!--代理人荣誉-->
							<div class="pic-scroll">
								<div class="big-pic">
									<img src="" id="big" style="width: 197px; height: 176px;" />
								</div>
								<div class="pic-scroll-title">
									恭喜
									<span id='aname'> </span>升级至
									<span id="alevel"> </span>
								</div>
								<div class="pic-scroll-btn">
									<div class="btn-left">
										<img src="../statics/images/left.gif" />
									</div>
									<ul>

										<c:forEach items="${paginationpromote.resultList}"
											var="promote" varStatus="count">
											<li aname="${promote.agentname}"
												apath="${path }${promote.path }" alevel="${promote.chnname}"
												acode="${promote.agentcode}" class="promot"
												id="li${count.index}">
												<a href="javascript:void(0);"> <img
														src="${path}${promote.path}"
														style="width: 46px; height: 46px;" /> </a>
											</li>
										</c:forEach>
										<!-- 
                                            <li><a href="###">
                                                <img src="../statics/images/pic-small.gif" /></a></li>
                                            <li><a href="###">
                                                <img src="../statics/images/pic-small.gif" /></a></li>
                                            <li><a href="###">
                                                <img src="../statics/images/pic-small.gif" /></a></li>
                                            <li><a href="###">
                                                <img src="../statics/images/pic-small.gif" /></a></li>
                                                 -->
									</ul>
									<div class="btn-right">
										<img src="../statics/images/right.gif" />
									</div>
									<div style="clear: both;">
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="webpart-foot">
						<div class="webpart-foot-item">
						</div>
					</div>
				</div>

				 

			</div>
			<div style="clear: both"> </div>
		</div>
</div>
		<sfa:indexFooter></sfa:indexFooter>


	</body>
</html>
